#include "fxcc/core/graph/common/Animation.h"

using namespace fxcc::graph::common;

Animation::Animation(aiAnimation* anim)
{
    Load(anim->mName, m_Name);
    m_Duration = anim->mDuration;
    m_TicksPerSecond = anim->mTicksPerSecond;
    m_TotalTime = m_Duration / m_TicksPerSecond;

    for (int i = 0; i < anim->mNumChannels; i++)
    {
        Channel channel(anim->mChannels[i]);
        m_Channels[channel.m_NodeName] = channel;
        m_Channels[channel.m_NodeName].m_Duration = m_Duration;

    }
}
